﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class CMS_Control_NoticeList : System.Web.UI.UserControl
{
    Usas.BLL.Cms.cms_block_common_detail cbcd = new Usas.BLL.Cms.cms_block_common_detail();
    Usas.Model.Cms.cms_block_common_detail cbcdm = new Usas.Model.Cms.cms_block_common_detail();
    Usas.BLL.Cms.cms_block cb = new Usas.BLL.Cms.cms_block();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            
            string id = cb.GetList("b_path='NoticeList.ascx'").Tables[0].Rows[0]["b_id"].ToString();
            string type = System.IO.Path.GetFileName(HttpContext.Current.Request.Path);

            DataSet ds = cbcd.GetList("c_b_id=" + id + " and c_type='" + type + "' and c_view=1");

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                content.Text = "<div id='rotate' style='display:none'><ul>";

                //string height = ((ds.Tables[0].Rows.Count + 1) * 60).ToString() + "px";
                string tbs = "";
                string output = "";
                //content.InnerHtml = "<div id='feature_list' style='width: 100%;overflow: hidden; position: relative; border-top: 10px;height:" + height + "'><ul id='tbs'>";
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    tbs += "<li><a href='#notice_list_" + ds.Tables[0].Rows[i]["c_id"].ToString() + "'><span>" + ds.Tables[0].Rows[i]["c_des"].ToString() + "</span></a></li>";
                    //tbs += "<li><a href='javascript:;'><h3>" + ds.Tables[0].Rows[i]["c_des"].ToString() + "</h3></a></li>";
                    //output += "<li ><div>" + ds.Tables[0].Rows[i]["c_value"].ToString() + "</div></li>";
                    output += "<div id='notice_list_" + ds.Tables[0].Rows[i]["c_id"].ToString() + "' class='l_dv'>" + ds.Tables[0].Rows[i]["c_value"].ToString() + "</div>";
                }
                content.Text += tbs + "</ul>" + output + "</div><br />";
                //content.InnerHtml += tbs + "</ul>";
                //content.InnerHtml += "<ul id='output'>" + output + "</ul></div>";
            }

        }
    }
}
